<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.com.ccxe.core.entity.Website"%>
<%@include file="/common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>"/>
    <title>修改网站资料</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>
	<style type="text/css">
		#upCusForm label.error{font-size:12px;color:red;}
		</style>
		
    <link id="editCss" rel="stylesheet" type="text/css" href="<%=path %>/css/style.css" />
    <link id="editCss" rel="stylesheet" type="text/css" href="<%=path%>/css/right.css" />
   	<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
		<script src="<%=path%>/js/jquery.validate.js" type="text/javascript"></script>
    
  <!-- validate begin  -->
	<script type="text/javascript">
	  $( jQuery.validator.addMethod("zip", function(value, element) { var tel = /^[0-9]{6}$/;  return this.optional(element) || (tel.test(value)); }, "请正确填写邮政编码"));
	
    $(
         function(){
               $('#upCusForm').validate({
             rules:{ type: {
                             required:true,
                             minlength:3,
                             maxlength:30,
                             onkeyup:false
                          }
                    },messages:{
                                  contactName:{ required:"请填写类型!" ,maxlength:"太长",minlength:"太短"},
                           },
                             submitHandler: function(form) { 
                        		     form.submit();
                               }
                    }); });	
	</script><!-- validate end  -->
	<script type="text/javascript">
	function isBlock(foo) {
		var listExpre = document.getElementById("list_expre");
		var articleExpre = document.getElementById("article_expre");
		var dateExpre = document.getElementById("date_expre");
		var datePattern = document.getElementById("date_pattern");
		if(foo) {
			listExpre.style.display = "";
			articleExpre.style.display = "";
			dateExpre.style.display = "";
			datePattern.style.display = "";
		} else {
			listExpre.style.display = "none";
			articleExpre.style.display = "none";
			dateExpre.style.display = "none";
			datePattern.style.display = "none";
		}
	}
	</script>
  </head>
  
<body class="bg" >

<div id="nav" class="crumbs">
	当前位置：<a href="<%=path %>/zebra/monitor/module/moduleAction" class="title">网站管理</a> 修改网站资料
</div>

<div class="search ctitle">
	<div class="tab">
		<span class="right"></span>
		<span class="font-blue14pxb">修改网站资料</span>
    </div>
</div>

<div class="tableBox fwidth" >
	<form id="updateForm" method="post" action="<%=path%>/zebra/monitor/module/moduleAction?method=update" >	
	<input type="hidden" name="id" id="id" maxlength="30"  value="${module.id }" style="width: 150px;color: #325f86;" />
	<input type="hidden" name="parentId" id="parentId" maxlength="30"  value="${module.parentId }" style="width: 150px;color: #325f86;" />
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	  <tr>
	     <td class="h">名称</td>
	     <td class="text_left">
	     <input name="name" id="name" maxlength="255" type="text" value="${module.name}" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	  <tr>
	     <td class="h">路径</td>
	     <td class="text_left">
	     <input name="path" id="path" type="text" value="${module.path }" style="width: 150px;color: #325f86;"/></td>
	  </tr>
	  	<tr>
			<td class="h">是否监控</td>
			<c:choose>
				<c:when test="${module.isMonitor == 1}">
					<td class="text_left" >
						是<input name="isMonitor" type="radio" value="1" checked="checked"/> 
						| 否<input name="isMonitor" type="radio" value="0"/>
					</td>
				</c:when>
				<c:otherwise>
					<td class="text_left" >
						是<input name="isMonitor" type="radio" value="1" /> 
						| 否<input name="isMonitor" type="radio" value="0" checked="checked"/>
					</td>
				</c:otherwise>
			 </c:choose>
		</tr>
			<c:set var="isList" value="${module.isList == 1}" />
			<c:out value="${isList}"></c:out>
			<tr >
				<td class="h">是否为文章列表</td>
				<td class="text_left"  >
				<% 	Website website = (Website)request.getAttribute("module");
					boolean isList = website.getIsList() == 1?true:false;
				%>
					是<input name="isList" type="radio" value="1" accept="<%=isList %>"  <%=isList?"checked=\"checked\"":"" %> onclick="isBlock(true)"/> 
					| 否<input name="isList" type="radio" value="0" <%=!isList?"checked=\"checked\"":"" %> onclick="isBlock(false)"/>
				</td>
			</tr>
			<tr id="list_expre" <%=isList?"":"style=\"display:none\"" %>>
				<td class="h" >列表采集表达式</td>
				<td class="text_left" >
					<input name="listPageExpre" id="listPageExpre" type="text" 
							maxlength="500" value="${rule.listPageExpre}"/>
					<a class="button" target="_blank" href="<%=path%>/zebra/monitor/module/help.jsp">帮助</a>
				</td>
			</tr>
			<tr id="article_expre" <%=isList?"":"style=\"display:none\"" %>>
				<td class="h" >文章采集表达式</td>
				<td class="text_left" >
					<input name="articleListExpre" id="articleListExpre" 
					type="text" maxlength="500" value="${rule.articleListExpre }"/> 
					<a class="button" target="_blank" href="<%=path %>/zebra/monitor/module/help.jsp" >帮助</a>
				</td>
			</tr>
	 	 
	 	 <tr id="date_pattern" <%=isList?"":"style=\"display:none\"" %>>
			<td class="h" >时间格式</td>
			<td class="text_left" >
				<input name="datePattern" id="datePattern" type="text" maxlength="500" value="${rule.datePattern }"/>
				<a class="button" target="_blank" href="<%=path%>/zebra/monitor/module/help.jsp">帮助</a>
			</td>
		</tr>
		<tr id="date_expre" <%=isList?"":"style=\"display:none\"" %>>
			<td class="h">时间采集表达式</td>
			<td class="text_left" >
				<input name="dateExpre" id="dateExpre" type="text" maxlength="500" value="${rule.dateExpre }"/> 
				<a class="button" target="_blank" href="<%=path%>/zebra/monitor/module/help.jsp">帮助</a>
			</td>
		</tr>
		<tr>
	     <td class="h">描述</td>
	     <td class="text_left">
	     	<input name="discription" id="discription" maxlength="500" 
     		type="text" value="${module.discription }" style="width: 150px;color: #325f86;"/>
	     </td>
	  </tr>
	  <tr>
		<td colspan="2" align="center">
			<input type="submit" name="save" value="修 改" class="button" onmouseover="this.className='button_mouseover'"
 				onmouseout="this.className='button'"/>
		</td>
	  </tr>
	</table>
	</form>
   </div>	
</body>
</html>
